package com.efast.cafe.portal.controller.statemach;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.efast.cafe.commponent.statemach.bean.StateMachTaskBean;
import com.efast.cafe.commponent.statemach.service.IPortalStateMachService;
import com.efast.cafe.framework.bean.ResultBean;
import com.efast.cafe.framework.controller.AbstractController;

@Controller
@RequestMapping("/statemach")
public class PortalStateMachController extends AbstractController {

	private IPortalStateMachService portalStateMachService;

	@Autowired
	public void setPortalStateMachService(IPortalStateMachService portalStateMachService) {
		this.portalStateMachService = portalStateMachService;
	}

	@RequestMapping(value = "/state/extdata")
	public @ResponseBody ResultBean StateExtDataByConfid(HttpServletRequest request, HttpServletResponse response,
			@RequestBody StateMachTaskBean obj) {
		ResultBean result = new ResultBean(true, null);
		result.setObject(portalStateMachService.GetStateExtDataByConfid(obj.getConfId(), obj.getStateId()));
		return result;
	}
}
